package com.glorystone.ins.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * Created by wangwei on 2018/3/15.
 */
public @Data @Builder @NoArgsConstructor @AllArgsConstructor class BusinessLog {

    /**
     * db model
     */
    private Long tid;
    private Integer businessType;
    private Long businessId;
    private String content;
    private String remark;
    private Long createBy;
    @JsonSerialize(using = CustomLocalDateTimeSerializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createAt;


    /**
     * param
     */
    private SysUser createUser;


    public enum ContentEnum {

        //新建渠道 编辑 渠道审核通过 渠道审核驳回 垫资授信申请 授信初审通过 授信初审驳回 授信终审通过 授信终审驳回 上传合同 风控复核通过 风控复核驳回 补齐保证金 保证金确认　
        CREATE_CHANNEL("新建渠道"),
        EDIT("编辑"),
        CHANNEL_AUDIT_PASS("渠道审核通过"),
        CHANNEL_AUDIT_REJECT("渠道审核驳回"),
        CREDIT_APPLY("垫资授信申请"),
        CREDIT_FIRST_PASS("授信初审通过"),
        CREDIT_FIRST_REJECT("授信初审驳回"),
        CREDIT_LAST_PASS("授信终审通过"),
        CREDIT_LAST_REJECT("授信终审驳回"),
        UPLOAD_CONTRACT("上传合同"),
        CREDIT_REVIEW_PASS("风控复核通过"),
        CREDIT_REVIEW_REJECT("风控复核驳回"),
        DEPOSIT_COMPLETE("补齐保证金"),
        DEPOSIT_ENSURE("保证金确认"),

        //新建  税点设置  自留点位设置  审核通过  审核驳回
        CREATE_PROJECT("新建产品"),
        SET_TAX_POINT("税点设置"),
        SET_EARNING_POINT("自留点位设置"),
        PRODUCT_CHECK_PASS("审核通过"),
        PRODUCT_CHECK_REJECT("审核驳回"),

        //订单的操作
        CREATE_ORDER("新建订单"),
		RESET_ORDER("订单审核驳回"),
		PASS_ORDER("订单审核通过"),
		AGREE_ORDER("确认定价审核通过"),
        PAY_ORDER_SUCCESS("订单支付成功"),
        PERFECT_ORDER("完善订单"),
        PAY_ORDER_FAIL("订单支付失败"),
 		REPAYING_INSURER_ORDER("退保核对"),
        REPAYING_CHANNEL_ORDER("退保结算"),		PAY_CHANNEL_SUCCESS("支付渠道返佣费"),        //垫资限额设置
        SET_ADVANCE_AMOUNT("垫资限额金额设置"),
        ADVANCE_CHECK_PASS("审核通过"),
        ADVANCE_CHECK_REJECT("审核驳回"),
        RECEIVABLE_CHECK("应收订单核对"),
        RECEIVABLE_INVOICE("应收订单开票"),
        RECEIVABLE_GATHERING("应收订单收款"),
        RECEIVABLE_SETTLEMENT("渠道应收订单结算"),
        RECEIVABLE_SETTLEMENT_AUDIT_ADOPT("应收订单结算审核通过"),
        RECEIVABLE_SETTLEMENT_AUDIT_REJECT("应收订单结算审核驳回"),
        RECEIVABLE_SURRENDER("应收订单退保");


        private String value;
        ContentEnum(String value) {
            this.value = value;
        }
        public String getValue() {
            return value;
        }
    }



    public enum BusinessTypeEnum {

        /**
         * 渠道
         */
        CHANNEL(1),

        /**
         * 订单
         */
        ORDER(2),

        /**
         *  产品
         */
        PRODUCT(3),

        /**
         * 垫资限额
         */
        ADVANCE_LIMIT(4);

        private int value;
        BusinessTypeEnum(int value) {

            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }







}
